import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'jdsdk_platform_interface.dart';

/// An implementation of [JdsdkPlatform] that uses method channels.
class MethodChannelJdsdk extends JdsdkPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('jdsdk');

  @override
  Future<String?> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }
  Future<String> init({required String appKey, required String appSecret}) async {
    final String version = await methodChannel.invokeMethod('init',{"appKey": appKey, "appSecret": appSecret});
    return version;
  }
  ///打开京东任意url
  Future<String> openUrl({required String url}) async {
    final String version = await methodChannel.invokeMethod('openUrl',{"url": url});
    return version;
  }
}
